package org.lex.dbq.view.browser;

import org.eclipse.swt.widgets.Composite;
import org.lex.dbq.model.bo.DriverConfig;
import org.lex.dbq.model.service.ServiceFactory;
import org.lex.dbq.view.Actions;
import org.lex.dbq.view.driver.DriverDialog;

public class DriverPane extends AbstractBrowser<DriverConfig> {

	public DriverPane(Composite parent) {
		super(parent, ServiceFactory.getDriverService());
	}

	@Override
	public void edit() {
		String name = this.getSelectedObjectName();
		DriverConfig dc = ServiceFactory.getDriverService().getByName(name);
		DriverDialog.showEdit(getShell(), dc);
	}

	public void add() {
		this.getActionService().getActionMap().get(Actions.ADD_DRIVER).run();
	}
}
